import request from '@/utils/request'

// 获取页面列表
export const getPageList = (params) => {
  return request({
    url: '/pages',
    params
  })
}

// 新建页面
export const postPage = (data) => {
  return request({
    url: '/pages',
    method: 'post',
    data
  })
}

// 删除页面
export const delPage = (id) => {
  return request({
    url: '/pages/' + id,
    method: 'delete'
  })
}
// 编辑页面
export const putPage = (data) => {
  return request({
    url: '/pages/' + data.id,
    method: 'put',
    data
  })
}
// 获取指定页面
export const getPageById = (id) => {
  return request({
    url: '/pages/' + id
  })
}
// 获取页面数量
export const getPageCount = (params) => {
  return request({
    url: '/pages/count',
    params
  })
}
